import java.util.*;
public class Player
{
   private String name;
   private int strength;
   private int defense;
   private int aggressivity;
   private Map<String, Food> bag = new HashMap<>();
   
   Player(String name, int strength, int aggressivity, int defense) {
       this.name=name;
       this.strength=strength;
       this.aggressivity=aggressivity;
       this.defense=defense;
   }
   
   public void pick(Food food) {
       bag.put(food.getName(), food);
   }
   
   public void eat(String name) {
       Food food = bag.get(name);
       if(food != null) {
           System.out.println("你吃掉了"+food.getName());
           strength += food.getEnergy();
           if(strength > 100) {
               strength = 100;
           }
           bag.remove(name);
       }
   }
   
   public void check() {
       System.out.println("生命力："+strength);
       System.out.println("攻击力："+aggressivity);
       System.out.println("防御力："+defense);
       System.out.println("物品栏");
       System.out.println("--------------");
       for(String key : bag.keySet()){
            System.out.println("   "+key+"   |");
       }
       System.out.println("--------------");
   }
   
  public void step() {
       strength -= 10;
   }
   
  public void setStrength(int strength) {
      this.strength=strength;
  }
    
  public void setAggressivity(int aggressivity) {
       this.aggressivity+=aggressivity;
  }  
   
  public void setDefense(int defense) {
       this.defense+=defense;
    }
   
    public String getName(){
       return name;
   }
    
   public int getStrength(){
       return strength;
   }
   
   public int getDefense(){
       return defense;
   }
  
   public int getAggressivity(){
       return aggressivity;
   }
   
   
}
